package com.atguigu.mylock;

public class MainMethod {
    public static void main(String[] args) {
        Resource resource = new Resource();

        new Thread(()->{
            for (int i = 1;i<=10;i++){
                try {
                    resource.print5(i);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        },"aaa").start();
        new Thread(()->{
            for (int i = 1;i<=10;i++){
                try {
                    resource.print10(i);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        },"bbb").start();
        new Thread(()->{
            for (int i = 1;i<=10;i++){
                try {
                    resource.print15(i);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        },"ccc").start();
    }
}
